#ifndef _planet_h__
#define _planet_h__
#include "physics/physicsobject.h"
#include "graphics/irenderer.h"
#include "gameentity.h"
#include <gtl/vector.h>

class Planet : public GameEntity
{
public:
	Planet();

	void Initialise(gecko::IEffect* effect);

	void InitialisePhysics(gecko::PhysicsWorld & physicsWorld);

	UpdateReturn Update(float dt);

	void Render(gecko::IRenderer* renderer);

	float rotationSpeed;
	gecko::Vector3f rotationAxis;
	float angle;
	gecko::gtl::Vector<gecko::DynamicGeometryInstance*> m_geometryInstances;

	// heightmap
	static const int RADIUS = 5;
	static const int MAX_SEGMENTS = 129;

private:
	void CreateTerrain(gecko::IEffect* effect);
	void CreateInnerSphere(gecko::IEffect* effect);
	void CreateAtmosphere(gecko::IEffect* effect);
};

#endif // _planet_h__